#ifndef PLAYER_H
#define PLAYER_H

#include <iostream>
#include <vector>
#include "item.h"

using namespace std;

class player
{
	public:
	
	player(ALLEGRO_BITMAP * playerImage);
	~player();
	ALLEGRO_BITMAP * playerImage;
	int x;
	int y;
	int speed;
	int hitPoints;
	vector<item*> itemz;
	int height;
	int width;
	
	void addToItemVector(item* itemA);
	void movePlayerUp();
	void movePlayerDown();
	void movePlayerLeft();
	void movePlayerRight();
	void changeX(int cX);
	void changeY(int cY);
	void hurt(int damage);
	
	private:
};

//Constructor takes in an image, sets x and y the first coordinate,
//height and witdth of the player, speed at which the player should move
//set the hitpoints to it's start point at 100
player::player(ALLEGRO_BITMAP * playerImage){
	x=394;
	y=416;
	speed = 2;
	height = 32; 
	width = 32;
	hitPoints = 100;
	this->playerImage=playerImage;
}
//Destructor
player::~player(){
}

//add and item for the player to carry
void player::addToItemVector(item* itemA){
	itemz.push_back(itemA);
}

//moves player up the screen
void player::movePlayerUp(){
	
	y=y-speed;
}

//moves player down the screen
void player::movePlayerDown(){
	
	y=y+speed;
}

//move the player left
void player::movePlayerLeft(){
	x=x-speed;
}

//move the player right
void player::movePlayerRight(){
	x=x+speed;
}

//change the x coordinant of the player
void player::changeX(int cX){
	x = cX;
}

//change the y coordinate of the player
void player::changeY(int cY){
	y = cY;
}

//take away hitpoints by passing in how much to take away
void player::hurt(int damage){
	hitPoints=hitPoints-damage;
}

#endif 
